import ajax from '@/utils/request'
import { concatUrl } from '@/utils'

// 取消道路救援单
export function cancelAssistance(data= {}) {
    return ajax({
        url: concatUrl('/v1/roadside-assistance/cancel'),
        data,
        method: 'POST'
    })
}

// 获取正在进行中订单
export function getAssistanceOrder(data= {}, fields: string | object = { fields: 'orderNumber,typeCn,address,statusCn,carLicense,mobile,storeName,createdAt,longitude,latitude,staffName,staffMobile,store,store.startTime,store.endTime,store.phone,store.managerMobile,store.storeName,assignList,assignList.staffName,assignList.mobile' }) {
    return ajax({
        url: concatUrl('/v1/roadside-assistance/order-in-progress',fields),
        data,
        method: 'GET'
    })
}

// 创建
export function createAssistance(data= {}) {
    return ajax({
        url: concatUrl('/v1/roadside-assistance/create'),
        data,
        method: 'POST'
    })
}